﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Microsoft Corp." file="TestServiceCredentials.cs">
//   All rights reserved. See License.txt in the project root for license information.
// </copyright>
// 
// --------------------------------------------------------------------------------------------------------------------
namespace AzureManagementTests.TestSupport
{
    using System.Net;

    using AzureManagement;

    using RestClient;

    public class TestServiceCredentials : IAzureServiceCredentials
    {
        private readonly string certificateThumbprint;

        public TestServiceCredentials(string subscriptionId, string certificateThumbprint)
        {
            this.certificateThumbprint = certificateThumbprint;
            this.SubscriptionId = subscriptionId;
        }

        public string SubscriptionId { get; private set; }

        public WebRequest Sign(WebRequest request)
        {
            var testWebRequest = request as TestWebRequest;
            testWebRequest.CertificateThumbprint = this.certificateThumbprint;

            return testWebRequest;
        }
    }
}